<?php
header("Content-type:text/html;charset=utf-8");
include '../service/InvitationService.class.php';
include '../service/UserService.class.php';
include '../util/class.log.php';
$username = $_POST['username'];
$user = new UserService();
$id = $user->selectUserIDByUsername($username);
$invitation = new InvitationService();
$result = $invitation->selectPostByPostId($id);
if($result == null)
{
	$array = array('tip' => 0);
	print_r(json_encode($array));
} else {
	echo $result;
}		
